<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">


    <title>房屋中介系统登录</title>


    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">

    <link rel="shortcut icon" href="../img/favicon.ico">
    <script src="../plugins/tempjs/html5shiv.js"></script>
    <script src="../plugins/tempjs/respond.min.js"></script>


    <link rel="stylesheet" href="../plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../plugins/ionicons/css/ionicons.min.css">
    <link rel="stylesheet" href="../plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="../plugins/iCheck/square/blue.css">
    <link rel="stylesheet" href="../css/zp.css">
    <link rel="stylesheet" href="../css/base.css">
</head>
<body >
    <div class="house">

        <div class="wenzi">
            <h1 href="#"><b>房屋中介</b>管理系统</h1>
        </div>

        <div class="boxlogin">
        <!--正常登录状态-->
        <p class="login-box-msg" id="normal"></p>
        <!--错误登录状态-->
        <p class="login-box-msg" id="information" style="color: red;"></p>
        </div>

        <form action="/login" method="post">
            <div class="login">
                <div class="zpLogin">
                    <input type="text"  placeholder="账户" name="userName">
                    <span><img src="../img/zploginName.png" alt=""></span>
                </div>
                <div class="zpLogin1">
                    <input type="password"  placeholder="密码" name="userPassword">
                    <span><img src="../img/zplock.png" alt=""></span>
                </div>
            </div>

            <div class="jizhu">
                    <div class="jizhu1">
<!--                        <label><input type="checkbox" > 记住 下次自动登录</label>-->
                    </div>
                <!-- /.col -->
                <div class="jizhu2">
                    <button type="submit" class="">登录</button>
                </div>
                <!-- /.col -->
            </div>
            <!-- <hr> -->
            <div class="wangji ">
                <div class="wangji1">
                    <a href="/pages/all-admin-password.html">忘记密码</a>
                </div>

                <div class="wangji2">
                    <a href="/pages/all-admin-register.html" class="btn btn-info"
                       style="right: 0px;position: relative">新用户注册</a>
                </div>

            </div>
        </form>



        
    </div>

    <div class="slip">
        <div class="left1">
            <img src="../img/people.png" alt="">
            
        </div>
        <div class="left2">
            <img src="../img/bus.png" alt="">
        </div>
        
        <div class="right">
            <img src="../img/tree.png" alt="">
        </div>
    </div>

    <div class="kite">
        <div class="kite1">
            <img src="../img/kite1.png" alt="">
        </div>
        <div class="kite2">
            <img src="../img/kite2.png" alt="">
        </div>
        <div class="kite3">
            <img src="../img/kite1.png" alt="">
        </div>
        
    </div>

    <!-- JS部分 -->
    <script src="../plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="../plugins/bootstrap/js/bootstrap.min.js"></script>
    <script src="../plugins/iCheck/icheck.min.js"></script>
    <script>
        $(function () {
            $('input').iCheck({
                checkboxClass: 'icheckbox_square-blue',
                radioClass: 'iradio_square-blue',
                increaseArea: '20%' // optional
            });
        });
    </script>
    
    <!--    处理登录失败返回来的数据-->
    <script>
        $(function () {
    
            $.ajax({
                url: "/login/error",
                type: "get",    //请求方式
                dataType: "json",  //设置接收到数据类型
                success: function (data) {
                    console.log(data);
                    if (data !== "") {
                        $("#normal").hide();   //隐藏正常信息
                        var errorData = eval('(' + data + ')');  // 把JSON字符串解析为javascript对象
                        $("#information").show();   //显示错误信息
                        $("#information").text(errorData.message);
    
                    } else {
                        $("#normal").show();   //正常信息
                        $("#normal").text("登录系统");   //正常信息
                        $("#information").hide();   //错误信息
                    }
                },
                error: function (e) {
                    console.log("报错：" + e);
                }
            });
    
    
        })
    
    </script>
</body>